﻿<?xml version="1.0" encoding="utf-8" ?>
<acma-unit-tests:test-data-set
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:acma-unit-tests="http://lithnet.local/acma-test-data.xsd"
                xmlns:acma="http://lithnet.local/acma-base.xsd"
                xmlns:acma-rules="http://lithnet.local/acma-rules.xsd"
                xmlns:fim-transforms="http://lithnet.local/fim-transforms.xsd"
                xmlns:acma-constructors="http://lithnet.local/acma-constructors.xsd">

  <test-data id="ValueConstructorMultivaluedToSingleValuedLongLargestTest">
    <attribute-constructor id="tbd003" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>activeExpiryDate</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{expiryDates>>MVToSVGetLargestInteger}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorMultivaluedToSingleValuedLongSmallestTest">
    <attribute-constructor id="tbd004" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>activeExpiryDate</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{expiryDates>>MVToSVGetSmallestInteger}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorMultivaluedToSingleValuedLongEqualsTest">
    <attribute-constructor id="tbd005" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>activeExpiryDate</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{expiryDates>>MVToSVEqualsInteger}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorMultivaluedToSingleValuedStringTest">
    <attribute-constructor id="tbd006" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>mail</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{mailAlternateAddresses>>MVToSVEqualsString}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorMultivaluedToSingleValuedBinaryTest">
    <attribute-constructor id="tbd007" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>objectSid</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{objectSids>>MVToSVEqualsBinary}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorMultivaluedToSingleValuedReferenceTest">
    <attribute-constructor id="tbd008" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>supervisor</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{directReports>>MVToSVEqualsGuid}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

  <test-data id="ValueConstructorSingleValuedtoMultivaluedTest">
    <attribute-constructor id="tbd009" xsi:type="acma-constructors:DeclarativeValueConstructor">
      <attribute>expiryDates</attribute>
      <rule-group operator="Any">
        <rule xsi:type="acma-rules:ObjectChangeRule" triggers="Add"/>
      </rule-group>
      <modification-type>replace</modification-type>
      <value-declarations>
        <value-declaration>{sapExpiryDate}</value-declaration>
        <value-declaration>{unixUid}</value-declaration>
      </value-declarations>
    </attribute-constructor>
  </test-data>

    



  <test-data id ="ValueConstructorShadowCreateTest">
    <attribute-constructor id="tbd036"  xsi:type="acma-constructors:ShadowObjectConstructor">
      <attribute>adMgrAccount</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:AttributeChangeRule" attribute="hasAdMgrAccount" triggers="Add Update Delete"/>
      </rule-group>
      <shadow-object-class>shadowAccountAuAdAdmin</shadow-object-class>
      <initial-flow-attributes>
        <initial-flow-attribute attribute="accountName">mgr-{accountName}</initial-flow-attribute>
      </initial-flow-attributes>
    </attribute-constructor>
  </test-data>


  <test-data id ="ValueConstructorShadowJoinTest">
    <attribute-constructor id="tbd037" xsi:type="acma-constructors:ShadowObjectConstructor">
      <attribute>adMgrAccount</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:AttributeChangeRule" attribute="hasAdMgrAccount" triggers="Add Update Delete"/>
      </rule-group>
      <shadow-object-class>shadowAccountAuAdAdmin</shadow-object-class>
      <initial-flow-attributes>
        <initial-flow-attribute attribute="accountName">mgr-{accountName}</initial-flow-attribute>
      </initial-flow-attributes>
      <join-attributes>
        <query-group operator="Any">
          <query xsi:type="acma:dbquery-ByAttribute" source-object-attribute="sapPersonId" target-object-attribute="sapPersonId" operator="Equals"/>
        </query-group>
      </join-attributes>
    </attribute-constructor>
  </test-data>

  <test-data id ="ValueConstructorShadowDeleteTest">
    <attribute-constructor  id="tbd038" xsi:type="acma-constructors:ShadowObjectConstructor">
      <attribute>adMgrAccount</attribute>
      <rule-group operator="All">
        <rule xsi:type="acma-rules:AttributeChangeRule" attribute="hasAdMgrAccount" triggers="Add Update Delete"/>
      </rule-group>
      <shadow-object-class>shadowAccountAuAdAdmin</shadow-object-class>
      <initial-flow-attributes>
        <initial-flow-attribute attribute="accountName">mgr-{accountName}</initial-flow-attribute>
      </initial-flow-attributes>
    </attribute-constructor>
  </test-data>


  <test-data id="MVToSVGreaterThanTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVGreaterThanTest1">
      <operator>GreaterThan</operator>
      <value>5</value>
    </transform>
  </test-data>
  <test-data id="MVToSVGreaterThanOrEqTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVGreaterThanOrEqTest1">
      <operator>GreaterThanOrEq</operator>
      <value>9</value>
    </transform>
  </test-data>
  <test-data id="MVToSVLessThanTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVLessThanTest1">
      <operator>LessThan</operator>
      <value>5</value>
    </transform>
  </test-data>
  <test-data id="MVToSVLessThanOrEqTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVLessThanOrEqTest1">
      <operator>LessThanOrEq</operator>
      <value>4</value>
    </transform>
  </test-data>
  <test-data id="MVToSVLargestTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVLargestTest1">
      <operator>Largest</operator>
    </transform>
  </test-data>
  <test-data id="MVToSVSmallestTest">
    <transform xsi:type="fim-transforms:MultivalueToSingleValue" id="MVToSVSmallestTest1">
      <operator>Smallest</operator>
    </transform>
  </test-data>
    
  <test-data id="ImportSafetyTestUnsafeData">
    <import-safety-rule name="Mail address prefix safety for non-production systems">
      <safe-pattern><![CDATA[^fimtest\+.+@.+\..+$]]></safe-pattern>
      <allow-null>true</allow-null>
      <attributes>
        <attribute>mail</attribute>
        <attribute>mailAlternateAddresses</attribute>
        <attribute>sapPersonalEmail</attribute>
        <attribute>callistaRegistrationEmail</attribute>
      </attributes>
    </import-safety-rule>
  </test-data>

  <test-data id="ImportSafetyTestUnsafeDataNull">
    <import-safety-rule name="Mail address prefix safety for non-production systems">
      <safe-pattern><![CDATA[^fimtest\+.+@.+\..+$]]></safe-pattern>
      <allow-null>false</allow-null>
      <attributes>
        <attribute>mail</attribute>
        <attribute>mailAlternateAddresses</attribute>
        <attribute>sapPersonalEmail</attribute>
        <attribute>callistaRegistrationEmail</attribute>
      </attributes>
    </import-safety-rule>
  </test-data>

  <test-data id="LdifImport1">
    <text>
      <![CDATA[
version:1
dn:test-dn
objectclass:person
firstName:test
surname:user
accountName:tuser1]]>
    </text>
  </test-data>
</acma-unit-tests:test-data-set>